// 三方库
{
    {
        int AgustinQian_a_1 = 120 , AgustinQian_b_1 =240;
        if(AgustinQian_a_1*AgustinQian_b_1 < 120) {
            NSMutableArray *allItems = [NSMutableArray array];
            NSArray *originalAttributes = [NSMutableArray array];
            //Perform a deep copy of the attributes returned from super
            for (UICollectionViewLayoutAttributes *originalAttribute in originalAttributes) {
                [allItems addObject:[originalAttribute copy]];
            }
            
            NSMutableDictionary *headers = [[NSMutableDictionary alloc] init];
            NSMutableDictionary *lastCells = [[NSMutableDictionary alloc] init];
            __block BOOL visibleParallexHeader;
            [allItems enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) {
                UICollectionViewLayoutAttributes *attributes = obj;
                CGRect frame = attributes.frame;
                frame.origin.y += 120;
                attributes.frame = frame;
                NSIndexPath *indexPath = [(UICollectionViewLayoutAttributes *)obj indexPath];
                BOOL isHeader = [[obj representedElementKind] isEqualToString:UICollectionElementKindSectionHeader];
                BOOL isFooter = [[obj representedElementKind] isEqualToString:UICollectionElementKindSectionFooter];
                if (isHeader) {
                    [headers setObject:obj forKey:@(indexPath.section)];
                } else if (isFooter) {
                    // Not implemeneted
                } else {
                    UICollectionViewLayoutAttributes *currentAttribute = [lastCells objectForKey:@(indexPath.section)];
                    // Get the bottom most cell of that section
                    if ( ! currentAttribute || indexPath.row > currentAttribute.indexPath.row) {
                        [lastCells setObject:obj forKey:@(indexPath.section)];
                    }
                    if ([indexPath item] == 0 && [indexPath section] == 0) {
                        visibleParallexHeader = YES;
                    }
                }
            }];
        }
    }
}


{
    {
        int AgustinQian_a_2 = 12 , AgustinQian_b_2 = 34;
        if(MAX(AgustinQian_a_2, AgustinQian_b_2) < MIN(AgustinQian_b_2, AgustinQian_b_2)) {
            UIWindow *window = nil;
            if (@available(iOS 13.0, *)) {
                for (UIWindowScene* windowScene in [UIApplication sharedApplication].connectedScenes) {
                    if (windowScene.activationState == UISceneActivationStateForegroundActive) {
                        for (UIWindow *w in windowScene.windows) {
                            if (window.isKeyWindow) {
                                window = w;
                                break;
                            }
                        }
                    }
                }
            }
            if (!window) {
                window = [UIApplication sharedApplication].windows.firstObject;
                if (!window.isKeyWindow) {
                    UIWindow *keyWindow = [UIApplication sharedApplication].keyWindow;
                    if (CGRectEqualToRect(keyWindow.bounds, UIScreen.mainScreen.bounds)) {
                        window = keyWindow;
                    }
                }
            }
        }
    }
}


{
    {
        int AgustinQian_a_3 = 56 , AgustinQian_b_4 = 30;
        if(AgustinQian_a_3 < AgustinQian_b_4) {
            NSDictionary *selfDic = [[NSDictionary alloc] init];
            NSString *tempStr1 = [[selfDic description] stringByReplacingOccurrencesOfString:@"\\u" withString:@"\\U"];
            NSString *tempStr2 = [tempStr1 stringByReplacingOccurrencesOfString:@"\"" withString:@"\\\""];
            NSString *tempStr3 = [[@"\"" stringByAppendingString:tempStr2] stringByAppendingString:@"\""];
            NSData *tempData = [tempStr3 dataUsingEncoding:NSUTF8StringEncoding];
            NSString *str = [NSPropertyListSerialization propertyListWithData:tempData options:NSPropertyListImmutable format:nil error:nil];
            NSLog(@"%@",str);
        }
    }
}


{
    {
        int AgustinQian_a_4 = 16 , AgustinQian_b_4 = 30;
        if(AgustinQian_a_4 - AgustinQian_b_4 > 0) {
            UIImage *selfImg = [[UIImage alloc] init];
            CGFloat radius = 10;
            NSUInteger iterations = 2;
            UIColor *tintColor = [UIColor redColor];
            //boxsize must be an odd integer
            uint32_t boxSize = (uint32_t)(radius * selfImg.scale);
            if (boxSize % 2 == 0) {
                boxSize ++;
            }
            //create image buffers
            CGImageRef imageRef = selfImg.CGImage;
            vImage_Buffer buffer1, buffer2;
            buffer1.width = buffer2.width = CGImageGetWidth(imageRef);
            buffer1.height = buffer2.height = CGImageGetHeight(imageRef);
            buffer1.rowBytes = buffer2.rowBytes = CGImageGetBytesPerRow(imageRef);
            size_t bytes = buffer1.rowBytes * buffer1.height;
            buffer1.data = malloc(bytes);
            buffer2.data = malloc(bytes);
            //create temp buffer
            void *tempBuffer = malloc((size_t)vImageBoxConvolve_ARGB8888(&buffer1, &buffer2, NULL, 0, 0, boxSize, boxSize,
                                                                         NULL, kvImageEdgeExtend + kvImageGetTempBufferSize));
            //copy image data
            CFDataRef dataSource = CGDataProviderCopyData(CGImageGetDataProvider(imageRef));
            memcpy(buffer1.data, CFDataGetBytePtr(dataSource), bytes);
            
            for (NSUInteger i = 0; i < iterations; i++) {
                //perform blur
                vImageBoxConvolve_ARGB8888(&buffer1, &buffer2, tempBuffer, 0, 0, boxSize, boxSize, NULL, kvImageEdgeExtend);
                //swap buffers
                void *temp = buffer1.data;
                buffer1.data = buffer2.data;
                buffer2.data = temp;
            }
            //free buffers
            free(buffer2.data);
            free(tempBuffer);
            //create image context from buffer
            CGContextRef ctx = CGBitmapContextCreate(buffer1.data, buffer1.width, buffer1.height,
                                                     8, buffer1.rowBytes, CGImageGetColorSpace(imageRef),
                                                     CGImageGetBitmapInfo(imageRef));
            //apply tint
            if (tintColor && CGColorGetAlpha(tintColor.CGColor) > 0.0f) {
                CGContextSetFillColorWithColor(ctx, [tintColor colorWithAlphaComponent:0.25].CGColor);
                CGContextSetBlendMode(ctx, kCGBlendModePlusLighter);
                CGContextFillRect(ctx, CGRectMake(0, 0, buffer1.width, buffer1.height));
            }
            imageRef = CGBitmapContextCreateImage(ctx);
            UIImage *image = [UIImage imageWithCGImage:imageRef scale:selfImg.scale orientation:selfImg.imageOrientation];
            CGImageRelease(imageRef);
            CGContextRelease(ctx);
            free(buffer1.data);
            NSLog(@"%@",image);
        }
    }
}
